home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / awt / GraphicsConfigTemplate.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  3.6 KB  |  100 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)GraphicsConfigTemplate.java    1.8 98/10/19
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.awt;
  16.  
  17. import java.awt.Component;
  18. import java.io.*;
  19.  
  20. /**
  21.  * The <code>GraphicsConfigTemplate</code> class is used to obtain a valid
  22.  * {@link GraphicsConfiguration}.  A user instantiates one of these
  23.  * objects and then sets all non-default attributes as desired.  The
  24.  * {@link GraphicsDevice#getBestConfiguration} method found in the
  25.  * {@link GraphicsDevice} class is then called with this
  26.  * <code>GraphicsConfigTemplate</code>.  A valid 
  27.  * <code>GraphicsConfiguration</code> is returned that meets or exceeds
  28.  * what was requested in the <code>GraphicsConfigTemplate</code>.
  29.  * @see GraphicsDevice
  30.  * @see GraphicsConfiguration
  31.  *
  32.  * @version     1.2 03/18/98
  33.  * @since       JDK1.2
  34.  */
  35. public abstract class GraphicsConfigTemplate implements Serializable {
  36.  
  37.     /**
  38.      * This class is an abstract class so only subclasses can be
  39.      * instantiated.
  40.      */
  41.     public GraphicsConfigTemplate() {
  42.     }     
  43.  
  44.     /**
  45.      * Value used for "Enum" (Integer) type.  States that this
  46.      * feature is required for the <code>GraphicsConfiguration</code> 
  47.      * object.  If this feature is not available, do not select the
  48.      * <code>GraphicsConfiguration</code> object.
  49.      */
  50.     public static final int REQUIRED    = 1;
  51.  
  52.     /**
  53.      * Value used for "Enum" (Integer) type.  States that this
  54.      * feature is desired for the <code>GraphicsConfiguration</code> 
  55.      * object.  A selection with this feature is preferred over a
  56.      * selection that does not include this feature, although both
  57.      * selections can be considered valid matches.
  58.      */
  59.     public static final int PREFERRED    = 2;
  60.  
  61.     /**
  62.      * Value used for "Enum" (Integer) type.  States that this
  63.      * feature is not necessary for the selection of the
  64.      * <code>GraphicsConfiguration</code> object.  A selection
  65.      * without this feature is preferred over a selection that
  66.      * includes this feature since it is not used. 
  67.      */
  68.     public static final int UNNECESSARY    = 3;
  69.  
  70.     /**
  71.      * Returns the "best" configuration possible that passes the
  72.      * criteria defined in the <code>GraphicsConfigTemplate</code>.
  73.      * @param gc the array of <code>GraphicsConfiguration</code>
  74.      * objects to choose from.
  75.      * @return a <code>GraphicsConfiguration</code> object that is
  76.      * the best configuration possible.
  77.      * @see GraphicsConfiguration
  78.      */
  79.     public abstract GraphicsConfiguration
  80.       getBestConfiguration(GraphicsConfiguration[] gc); 
  81.  
  82.     /**
  83.      * Returns a <code>boolean</code> indicating whether or 
  84.      * not the specified <code>GraphicsConfiguration</code> can be 
  85.      * used to create a drawing surface that supports the indicated
  86.      * features.
  87.      * @param gc the <code>GraphicsConfiguration</code> object to test
  88.      * @return <code>true</code> if this 
  89.      * <code>GraphicsConfiguration</code> object can be used to create
  90.      * surfaces that support the indicated features; 
  91.      * <code>false</code> if the <code>GraphicsConfiguration</code> can
  92.      * not be used to create a drawing surface usable by this Java(tm)
  93.      * API.
  94.      */
  95.     public abstract boolean
  96.       isGraphicsConfigSupported(GraphicsConfiguration gc);
  97.  
  98. }
  99.  
  100.